﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Web.WebPages.OAuth;
using giaoxuhaison.Models;
using giaoxuhaison.Models;

namespace giaoxuhaison
{
    public static class AuthConfig
    {
        public static void RegisterAuth()
        {
            // To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
            // you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166

            //OAuthWebSecurity.RegisterMicrosoftClient(
            //    clientId: "",
            //    clientSecret: "");

            //OAuthWebSecurity.RegisterTwitterClient(
            //    consumerKey: "",
            //    consumerSecret: "");

            //OAuthWebSecurity.RegisterFacebookClient(
            //    appId: "",
            //    appSecret: "");

            //OAuthWebSecurity.RegisterGoogleClient();

            SetUserGuest();
        }

        public static void SetUserGuest()
        {
            if (UserInfo == null)
            {
                User user = new User();
                user.UserID = 1;
                user.UserName = "Guest";
                user.DisplayName = "Khách";
                user.UserPass = "";
                user.Locked = false;
                user.CreationBy = 1;
                user.CreationDate = DateTime.Now;
                user.LastUpdatedBy = 1;
                user.LastUpdatedDate = DateTime.Now;

                UserInfo = user;
            }
        }

        public static User UserInfo { get; set; }
    }
}
